<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    /* 样式表 */
    /* 瀑布流容器 */
    .container {
      display: flex;
      width: 400px;
      height: 1000px;
      background-color: rgb(230, 230, 250);
      flex-wrap: wrap;
      flex-direction: column;
    }

    /* div 统一样式 */
    .container div {
      border-radius: 10px;
      margin: 10px;
    }

    /* 偶数div设置颜色 */
    .container div:nth-child(odd) {
      background-color: rgb(255, 250, 205);
    }

    /* 奇数div设置颜色 */
    .container div:nth-child(even) {
      background-color: rgb(240, 128, 128);
    }

    /* 前4个div设置高度 */
    .container div:nth-child(-n + 4) {
      height: 220px;
    }

    /* 后4个div设置高度 */
    .container div:nth-child(n + 4) {
      height: 200px;
    }

    /* 三角形 */
    .triangle {
      width: 0;
      height: 0;
      border: 100px solid transparent;
      border-top-color: rgb(246, 42, 246);
      transform: rotate(45deg);
    }

    /* 骰子 */
    [class^=dice] {
      width: 360px;
      height: 360px;
      border-radius: 10px;
      background-color: lavender;
      margin: 20px;
    }

    .dot {
      width: 100px;
      height: 100px;
      margin: 10px;
      background-color: lavenderblush;
    }

    /* 1 */
    .dice1 {
      justify-content: center;
      align-items: center;
      display: flex;
    }

    /* 2 */
    .dice2 {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: flex-start;
    }

    .dice2 .dot:last-child {
      align-self: flex-end;
    }

    /* 3 */
    .dice3 {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: flex-start;
    }

    .dice3 .dot:nth-child(2) {
      align-self: center;
    }

    .dice3 .dot:last-child {
      align-self: flex-end;
    }

    /* 4 */
    .dice4 {
      display: flex;
      justify-content: space-between;
      align-content: space-between;
      flex-wrap: wrap;
    }

    .dice4 .dot:nth-child(even) {
      margin-left: 50px;
    }

    .dice4 .dot:nth-child(odd) {
      margin-right: 50px;
    }

    /* 5 */
    .dice5>div {
      display: flex;
      justify-content: space-between;
      align-content: space-between;
    }

    .dice5 .second {
      justify-content: center;
    }

    /* 6 */
    .dice6 {
      display: flex;
      justify-content: space-between;
      align-content: space-between;
      flex-wrap: wrap;
    }

    .dice6 .dot:nth-child(even) {
      margin-left: 50px;
    }

    .dice6 .dot:nth-child(odd) {
      margin-right: 50px;
    }
  </style>
</head>

<body>
  <!-- 瀑布流，给其中两个项目设置不同的高度，行成高度差 -->
  <h1>瀑布流</h1>
  <div class="container">
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
    <div class="item"></div>
  </div>
  <!-- 三角形 -->
  <h1>三角形</h1>
  <div class="triangle"></div>
  <!-- 骰子六面 -->
  <h1>骰子</h1>
  <div class="mydice">
    <!-- 1 -->
    <div class="dice1">
      <div class="dot"></div>
    </div>
    <!-- 2 -->
    <div class="dice2">
      <div class="dot"></div>
      <div class="dot"></div>
    </div>
    <!-- 3 -->
    <div class="dice3">
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
    </div>
    <!-- 4 -->
    <div class="dice4">
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
    </div>
    <!-- 5 -->
    <div class="dice5">
      <div class="first">
        <div class="dot"></div>
        <div class="dot"></div>
      </div>
      <div class="second">
        <div class="dot"></div>
      </div>
      <div class="third">
        <div class="dot"></div>
        <div class="dot"></div>
      </div>
    </div>
    <!-- 6 -->
    <div class="dice6">
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
      <div class="dot"></div>
    </div>
  </div>
</body>

</html>